/** 
 * 2011-10-11 下午03:28:48 
 * UdpContent.java 
 * author:sunb 
 */
package com.u6.udp.util;

import java.net.SocketAddress;
import java.util.HashMap;
import java.util.Map;

/**
 * @author sunbin
 * 
 */
public class UdpContext {

	private static final Map<Long, SocketAddress> addressMap = new HashMap<Long, SocketAddress>();

	public static SocketAddress getAddressByUid(long uid) {
		return addressMap.get(uid);
	}

	public static void addAddress(long uid, SocketAddress socketAddress) {
		if (getAddressByUid(uid) != null) {
			addressMap.remove(uid);
		}
		addressMap.put(uid, socketAddress);

	}

}
